
//--------------------------------------------------------------------------------------
// implement the function
// final function that builds the market table from the json object
function fillMarketAssetListAndDescription(marketDataDictionary0) 
{
    marketDataDictionary = eval( marketDataDictionary0.responseText );
    listLeft = document.getElementById('myLeftList');
    listRight = document.getElementById('myRightList');
	var data = new google.visualization.DataTable();
	for (var i = 0; i < marketDataDictionary[0].assets.length; i++)
	{
	    //creates the bullet point
	    var liTag = document.createElement('li'); 
	    liTag.innerHTML = marketDataDictionary[0].assets[i].assetName + ": "+ marketDataDictionary[0].assets[i].assetDescription;
	    // we display one over two on the left, one over two on the right hand side
        if( ( 2 * Math.floor(i/2) ) == i )
        {
            listLeft.appendChild(liTag);
        }
        else
        {
            listRight.appendChild(liTag);
        }
	}
}

//--------------------------------------------------------------------------------------------------------------------
// this function asks for the list of the assets and call the function wich creates the list with the assets and their description
function fillMarketAssetListAndDescriptionRequest()
{
    var args = { 
           type: "POST", 
           url: "/json/getSpecificJson/",
           cache: false,
           data: { 'includeNonStd' : false, 'func' :'getAssets' }, 
           complete:function(res)  {  fillMarketAssetListAndDescription(res); },
           error: function(errorThrown)  { document.write(errorThrown.responseText);  }
           };
    $.ajax(args);
    return false;  
};